<cfcomponent extends="assets.calgrants.com.Base">

	<cfscript>
        import assets.calgrants.com.bo.StudentFacebookLike;
	</cfscript>
	
	<cffunction name="get" access="public" output="false" returntype="assets.calgrants.com.bo.StudentFacebookLike">
		<cfargument name="Student_Facebook_Like_ID" type="numeric" required="true" />
		<cfscript>
			if (arguments.Student_Facebook_Like_ID gt 0) {
				local.loadArgs = {};
				local.loadArgs.obj = new StudentFacebookLike();
				StructAppend(local.loadArgs, QueryToStruct(read(argumentCollection = arguments))[1]);
				return load(argumentCollection = local.loadArgs);
			} else {
				return new StudentFacebookLike();
			}
		</cfscript>
	</cffunction>
	
	<cffunction name="load" access="public" output="false" returntype="assets.calgrants.com.bo.StudentFacebookLike">
		<cfargument name="obj" type="assets.calgrants.com.bo.StudentFacebookLike" required="true" />
		<cfscript>
			local.obj = arguments.obj;
			if (IsDefined("arguments.Student_Facebook_Like_ID")) {
				local.obj.setStudent_Facebook_Like_ID(arguments.Student_Facebook_Like_ID);
			}
			if (IsDefined("arguments.Deleted")) {
				local.obj.setDeleted(arguments.Deleted);
			}
			if (IsDefined("arguments.Student_Facebook_ID")) {
				local.obj.setStudent_Facebook_ID(arguments.Student_Facebook_ID);
			}
			if (IsDefined("arguments.URL")) {
				local.obj.setURL(arguments.URL); 
			}
			if (IsDefined("arguments.Date_Created")) {
				local.obj.setDate_Created(arguments.Date_Created);
			}
			return local.obj;
		</cfscript>
	</cffunction>

	<cffunction name="read" access="public" output="false" returntype="any">
		<cfargument name="Student_Facebook_Like_ID" required="false" default="" />
		<cfargument name="Deleted" required="false" default="0" />
		<cfargument name="Student_Facebook_ID" required="false" default="" />
		<cfargument name="URL" required="false" default="" />
		<cfargument name="Date_Created" required="false" default="" />

		<cfset var recs = "">
		<cfstoredproc datasource="#getDatasource()#" procedure="readStudentFacebookLike">
			<cfprocparam value="#arguments.Student_Facebook_Like_ID#" cfsqltype="CF_SQL_INTEGER" null="#IIf(Len(Trim(arguments.Student_Facebook_Like_ID)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Deleted#" cfsqltype="CF_SQL_BIT" null="#IIf(Len(Trim(arguments.Deleted)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Student_Facebook_ID#" cfsqltype="CF_SQL_INTEGER" null="#IIf(Len(Trim(arguments.Student_Facebook_ID)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.URL#" cfsqltype="CF_SQL_VARCHAR" null="#IIf(Len(Trim(arguments.URL)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Date_Created#" cfsqltype="CF_SQL_TIMESTAMP" null="#IIf(Len(Trim(arguments.Date_Created)) eq 0, true, false)#" />
			<cfprocresult name="recs" />
		</cfstoredproc>
		<cfreturn recs />
	</cffunction>

	<cffunction name="save" access="public" output="false" returntype="any">
		<cfargument name="studentFacebookLike" required="true" type="assets.calgrants.com.bo.StuentFacebookLike" />

		<cfstoredproc datasource="#getDatasource()#" procedure="saveStudentFacebookLike">
			<cfprocparam value="#studentFacebookLike.getStudent_Facebook_Like_ID()#" cfsqltype="CF_SQL_INTEGER" variable="id" type="inout" null="false" />
			<cfprocparam value="#studentFacebookLike.getDeleted()#" cfsqltype="CF_SQL_BIT" null="false" />
			<cfprocparam value="#studentFacebookLike.getStudent_Facebook_ID()#" cfsqltype="CF_SQL_INTEGER" null="false" />
			<cfprocparam value="#studentFacebookLike.getURL()#" cfsqltype="CF_SQL_VARCHAR" null="false" />
		</cfstoredproc>
		<cfreturn id />
	</cffunction>

	<cffunction name="destroy" access="public" output="false" returntype="any">
		<cfargument name="Student_Facebook_Like_ID" required="true" />

		<cfstoredproc datasource="#getDatasource()#" procedure="destroyStudentFacebookLike">
			<cfprocparam value="#arguments.Student_Facebook_Like_ID#" cfsqltype="CF_SQL_INTEGER" null="false" />
			<cfprocparam value="true" cfsqltype="CF_SQL_BIT" null="false" />
		</cfstoredproc>
		<cfreturn true />
	</cffunction>

</cfcomponent>

